package com.hh.test.design.singleton;

public class StaticInnerClass {

	static {
		System.out.println("begin Sub class ");
	}

	private StaticInnerClass() {

	}

	private static class Instance {
		static {
			System.out.println("begin inner class");
		}
		static StaticInnerClass ins = new StaticInnerClass();

	}

	public static StaticInnerClass getInstance() {
		return Instance.ins;
	}

	public static void main(String[] args) {
		System.out.println("begin");
		System.out.println(StaticInnerClass.getInstance());
		System.out.println(StaticInnerClass.getInstance());
		System.out.println(StaticInnerClass.getInstance());
		System.out.println(StaticInnerClass.getInstance());
		System.out.println(new StaticInnerClass());

	}
}
